package product.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.feign.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import product.domain.SkuInfo;
import product.service.SkuInfoService;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * sku信息(SkuInfo)表控制层
 *
 * @author panghu
 * @since 2023-03-04 21:09:17
 */
@RestController
@RequestMapping("product/skuInfo")
public class SkuInfoController {

    @Autowired
    private SkuInfoService skuInfoService;


    @GetMapping("list")
    public R list(@RequestParam Map<String, Object> params) {
        Page<SkuInfo> skuInfoPage = skuInfoService.querPage(params);
        return R.ok().put("data", skuInfoPage);
    }

    @GetMapping("info/{skuId}")
    public R info(@PathVariable Long skuId) {
        SkuInfo skuinfo = skuInfoService.getById(skuId);
        return R.ok().put("data", skuinfo);
    }

}

